#include <Arduino.h>
#include <LittleFS.h>
#include <FS.h>

void setup()
{
    Serial.begin(9600);
    if (LittleFS.begin())
    {
        // 启动SPIFFS
        Serial.println("LittleFS Started.");
    }
    else
    {
        Serial.println("LittleFS Failed to Start.");
    }

    File file = LittleFS.open("/index.html", "r");
    if (file)
    {
        Serial.println("文件内容：");
        while (file.available())
        {
            Serial.write(file.read());
        }
        file.close();
    }
    else
    {
        Serial.println("文件打开失败");
    }
}

void loop()
{
}
// pio run -t clean清理缓存
// pio run -t uploadfs 重新上传
// board_bulid.filesystem = littlefs